package com.iamteer.contact;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

public class testContactOperatorImpl {
	ContactOperator operator = null;
	
	@Before
	public void init() {
		operator = new ContactOperatorImpl();
	}
	
	public void testAddContact(){
		Contact contact = new Contact();
		contact.setId("002");
		contact.setName("eric");
		contact.setAge(20);
		contact.setGender("男");
		contact.setPhone("12482984018");
		contact.setEmail("eric@foxmail.com");
		contact.setQq("432084302");
		
		operator.addContact(contact);
	}
	
	public void testUpdateContact() {
		Contact contact = new Contact();
		contact.setId("001");
		contact.setName("Celia");
		contact.setAge(18);
		contact.setGender("女");
		contact.setPhone("111111111");
		contact.setEmail("celia@foxmail.com");
		contact.setQq("88888888");
		
		operator.updateContact(contact);
	}
	
	
	public void testDeleteContact() {
		operator.deleteContact("002");
	}
	@Test
	public void testFindAll() {
		List<Contact> list = operator.findAll();
		for (Contact contact : list) {
			System.out.println(contact);
		}
	}
}
